/***************************************************************************
 *  Filename: flightdata.cpp
 *  Class: FlightData
 *  
 *  Copyright 2012  Jacco van der Spek
 *  <jaccovdspek@gmail.com>
 *
 *  Copyright 2012  Mario Henrique Voorsluys
 *  <forcaeluz@gmail.com>
 *  
 ****************************************************************************/

/*
 *
 * This file is part of %ProjectName%.
 *
 *    %ProjectName% is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    %ProjectName% is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with %ProjectName%.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "flightdata.h"

FlightData::FlightData()
{
    batteryState = 0;
    arDroneState = 0;
    steering = 0;
    baroAltitude = 0;
    arDroneAltitude = 0;
}

GPSData FlightData::getGPSData(){
    return gpsData;
}

float FlightData::getBaroAltitude(){
    return baroAltitude;
}

float FlightData::getArDroneAltitude(){
    return arDroneAltitude;
}

float FlightData::getAltitude(){
    if(arDroneAltitude > 2.0){
        return baroAltitude;
    }else{
        return arDroneAltitude;
    }
}

quint16 FlightData::getBattery(){
    return batteryState;
}

quint32 FlightData::getArDroneStatus(){
    return arDroneState;
}

quint8 FlightData::getSteering(){
    return steering;
}

float FlightData::getRoll(){
    return roll;
}

float FlightData::getPitch(){
    return pitch;
}

float FlightData::getYaw(){
    return yaw;
}

float FlightData::getVx(){
    return vx;
}

float FlightData::getVy(){
    return vy;
}

float FlightData::getVz(){
    return vz;
}

void FlightData::setGPSData(GPSData input){
    gpsData = input;
}

void FlightData::setBaroAltitude(double baroAlt){
    baroAltitude = baroAlt;
}

void FlightData::setDroneAltitude(float droneAlt){
    arDroneAltitude = droneAlt;
}
void FlightData::setBattery(int tBattery){
    batteryState = tBattery;
}
void FlightData::setArDroneStatus(uint status){
    arDroneState = status;
}

void FlightData::setSteering(unsigned char tSteering){
    steering = tSteering;
}

void FlightData::setAngles(float roll, float pitch, float yaw){
    this->roll = roll;
    this->pitch = pitch;
    this->yaw = yaw;
}

void FlightData::setVelocities(float vx, float vy, float vz){
    this->vx = vx;
    this->vy = vy;
    this->vz = vz;
}
